home *** CD-ROM | disk | FTP | other *** search
/ Plug-In Power Pack for Netscape Communicator / Plug-In Power Pack for Netscape Communicator.iso / plugins / dataviews / include / dstypes.h next >
C/C++ Source or Header  |  1997-05-08  |  6KB  |  165 lines

  1. /* SccsId[]= @(#)dstypes.h    V1.19    3/16/95 */
  2. /*
  3. |    file name - dstypes.h
  4. |===================================================================
  5. |
  6. |    copyright (c) 1991, V. I. Corporation
  7. |
  8. |    Note: absorbed the contents of "newtypes.h"
  9. |
  10. |===================================================================
  11. */
  12.  
  13. #ifndef DSTYPESINCLUDED
  14. #define DSTYPESINCLUDED
  15.  
  16. #include "dvfds.h"
  17.  
  18. /* datasource type flags */
  19.  
  20. #define DSPROCESS    1   /* process datasource*/
  21. #define DSFILE        2   /* file datasource*/
  22. #define DSCONSTANT    3   /* constant datasource*/
  23. #define DSFUNCTION    5   /* function datasource*/
  24. #define DSMEMORY    6   /* memory datasource*/
  25.  
  26. /*-------------------------------------------------------------------*/
  27. /* local variable structure */
  28. typedef struct localdata
  29.   {
  30.   struct localdata *next;
  31.   int checkf;            /* flag indicating type of list element */
  32.   char *name;
  33.   struct dsgphlnk *links;/* pointer to list of fcn args that use this */
  34.   char type;        /* data type - 1 of: AT_DNUM AT_TEXT AT_INUM */
  35.                    /* type determines which element of union */
  36.   double dnum;
  37.   LONG inum;
  38.   char *text;
  39.   } MLOCDAT;
  40.  
  41. /* function argument structure                         */
  42. typedef struct fcnargs 
  43.   {
  44.   struct fcnargs *next;
  45.   int checkf;                /* flag indicating type of list element */
  46.   char *argname;        /* arg name, from argdesc or NULL */
  47.   V_FDS_ARG_DECL *argdesc;       /* prototype descriptor */
  48.   struct fcncall *myfcn;    /* ptr to "owner" function */ 
  49.   char type;        /* arg type - one of: 
  50.                AT_DSV AT_DNUM AT_TEXT AT_INUM AT_LOC 
  51.                       type determines which of the following
  52.                fields is currently active */
  53.   struct datsrclst *dsv;
  54.   double dnum;
  55.   char *text;
  56.   LONG inum;
  57.   MLOCDAT *locdat;
  58.   } MFCNARGS;
  59.  
  60. /* function call definition structure                                */
  61. typedef struct fcncall
  62.   {
  63.   char *fcnname;        /* function name - looked up in Musrsubr */
  64.   int checkf;                /* flag indicating type of list element */
  65.   V_FDS_FCN_DESC *fcndesc;       /* prototype descriptor */
  66.   struct mdsrc *myds;          /* ptr to "owner" datasource */
  67.   ADDRESS (*fcnaddress)();    /* function pointer */
  68.   MFCNARGS *fcnargs;        /* function arguments */
  69.   } MFCNCALL;
  70.  
  71. /*-------------------------------------------------------------------*/
  72. /* This structure implements a linked list of back pointers from data
  73.    source variables back to referencing graph variables or datasource 
  74.    variables */
  75.  
  76. typedef struct dsgphlnk
  77.    {
  78.    struct dsgphlnk *next;
  79.    int checkf;            /* flag indicating type of list element */
  80.    char type;        /* GVC_G (graph var) GVC_ARG (function argument) */
  81.    ADDRESS refptr;    /* pointer to a graph variable or fcn arg */
  82.    }MGVC;
  83.  
  84. /*-------------------------------------------------------------------*/
  85. /* Structure to define the data source variables.             */
  86.  
  87. typedef struct datsrclst
  88.    { 
  89.    ADDRESS datbuff;    /* pointer to location of actual data */
  90.    int checkf;        /* flag indicating type of list element */
  91.    struct datsrclst *next;
  92.    char *cformat;    /* C format specification, i.e. "%c" */
  93.    float initval;    /* initial value */
  94.    int d1;        /* size in dimension 1 */
  95.    int d2;        /* size in dimension 2 */
  96.    LONG bufsize;     /* size of largest graph variable which points 
  97.                to this structure */
  98.    LONG numbufbytes;    /* Number of bytes actually allocated when
  99.                datbuff was created. */
  100.    char *name;        /* variable identifier */
  101.    MGVC *refslist;    /* pointer to list of graph vars, ds's or ds vars
  102.                            which point to this structure */
  103.    struct mdsrc *myds;    /* pointer to data source containing variable*/
  104.    char delimiter;      /* delimiter character for text vars*/
  105.    DV_BOOL marked;    /* DVdraw flag - set if var is marked */
  106.    MFCNCALL *fcncalls[V_FDS_FCN_MAX_TYPES]; /* function calls for fcn ds's */
  107.    ADDRESS fcndata;    /* (user set)ptr to data for use by varfcn */
  108.    VOID (*freefcn)();    /* (user set)fcn to free data when dsrc closed*/
  109.    int global;        /* global flag.  if DSV_GLOBAL then this variable
  110.                is available for sd dynamics remapping */
  111.    }MVDS;
  112.  
  113. /*-------------------------------------------------------------------*/
  114. /* Structure to define the data source parameters.             */
  115.  
  116. typedef struct mdsrc
  117.    {
  118.    struct mdsrc *next;
  119.    int checkf;    /* flag indicating type of list element */
  120.    UBYTE sstype;    /* file, process, or constant */
  121.    UBYTE ssformat;    /* keyed, sequential, or binary */
  122.    char *ssname;        
  123.    FILE *ssinfile;        
  124.    char ssiterchar,
  125.      ssvarchar,
  126.        sselemchar;     /* optional seperator characters */
  127.    UBYTE ssfilestate;     /* open,  eof, or closed */
  128.    MVDS *ssvspclist;     /* pointer to variables associated with this 
  129.                 data source */
  130.    struct dsl *mydsl;     /* pointer to dsl in which datasource exists */
  131.    MFCNCALL *fcncalls[V_FDS_FCN_MAX_TYPES]; /* function calls for fcn ds's */
  132.    MLOCDAT *locdat;     /* list of local data buffers */
  133.    DV_BOOL ssisdfltfcns; /* NO if fcns changed from default, YES else */
  134.    DV_BOOL ssisdfltname; /* NO if name changed from default, YES else */
  135.    char *fdsname;     /* fcn set name (saved and restored) */
  136.    V_FDS_DESC *fdsdesc;  /* fcn set descriptor (not saved) */
  137.    ADDRESS fcndata;     /* (user set) ptr to data for use by fcns */
  138.    VOID (*freefcn)();     /* (user set) fcn to free data when dsrc closed */
  139.    }MDSRC;
  140.  
  141. /*-------------------------------------------------------------------*/
  142. typedef struct dsl
  143.    {
  144.    struct mdsrc *datsrc;/* pointer to list of data sources */
  145.    int checkf;
  146.    int refcount;    /* count of # of views sharing this dsl */
  147.    } MDSL;
  148.    
  149. /*-------------------------------------------------------------------*/
  150.  
  151. typedef struct mdv_s
  152.    {
  153.    LONG drawings;    /* access to structures on drawings side of 
  154.                data strucuture, includes graph list     */
  155.    int checkf;
  156.    MDSL *dsl;        /* pointer to header of data source list */
  157.    int iterations;
  158.    int delay;
  159.    char *comment;    /* Comment field associated with the view */
  160.    OBJECT dynamic_dq;    /* deque of dynamic objects in view */
  161.    LONG drawing_version;  /* version of drawing - used to update dyn dq */
  162.    }MDV;
  163.  
  164. #endif
  165.